.\"     $OpenBSD: diskmap.4,v 1.2 2010/09/07 12:34:22 jmc Exp $
.\"
.\" Copyright (c) 2010 Joel Sing <jsing@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: September 7 2010 $
.Dt DISKMAP 4
.Os
.Sh NAME
.Nm diskmap
.Nd disklabel UID mapping interface
.Sh SYNOPSIS
.Fd #include <sys/dkio.h>
.Sh DESCRIPTION
The
.Nm
driver provides userland applications with a means to map a disklabel UID to
an actual device and open that device in one atomic operation.
This is achieved via the DIOCMAP
.Xr ioctl 2
command.
.Pp
The ability to use a disklabel UID is helpful in situations
where a disk may appear to the operating system under different device names.
For example,
plugging USB keys into differently configured systems (think sd0 or sd1),
or swapping between IDE and AHCI on a disk controller (wd0 or sd0).
Although the device names may change,
the operating system is still able to identify the disk by its UID.
.Sh FILES
.Bl -tag -width /dev/diskmap -compact
.It Pa /dev/diskmap
diskmap device
.El
.Sh SEE ALSO
.Xr ioctl 2 ,
.Xr disklabel 8
.Sh HISTORY
The
.Nm
driver first appeared in
.Ox 4.8 .
.Sh AUTHORS
The
.Nm
driver was written by
.An Joel Sing .
